package com.xujl.mvcbind.repository;

import com.xujl.mvcbind.bean.UserInfoBean;

/**
 * @author x
 * @Description
 */
public class DataRepository implements ILocalData, IHttpData {
    private IHttpData mHttpData;
    private ILocalData mLocalData;

    private DataRepository () {
        mHttpData = new HttpDataImpl();
        mLocalData = new LocalDataImpl();
    }

    public static DataRepository getInstance () {
        return Holder.DATA_REPOSITORY;
    }

    @Override
    public UserInfoBean getUserInfo () {
        return mLocalData.getUserInfo();
    }

    @Override
    public void saveUserInfo (UserInfoBean userInfoBean) {
        mLocalData.saveUserInfo(userInfoBean);
    }

    private static class Holder {
        private static final DataRepository DATA_REPOSITORY = new DataRepository();
    }


}
